package com.aweqy.porcelain.service.impl;

import com.aweqy.porcelain.entity.Region;
import com.aweqy.porcelain.mapper.RegionMapper;
import com.aweqy.porcelain.service.RegionService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 地区信息Service实现类
 */
@Service
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService {
    
    @Override
    public List<Region> getAllRegions() {
        return this.list();
    }
    
    @Override
    public Region getRegionById(Integer regionId) {
        return this.getById(regionId);
    }
    
    @Override
    public List<Region> getRegionsByGeoArea(String geoArea) {
        QueryWrapper<Region> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("geo_area", geoArea);
        return this.list(queryWrapper);
    }
} 